﻿@using KRM.Core

@using KRM.Core.Library
@{
    ViewBag.Title = "MedicalQuestionnaire";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<link href="~/hr/css/pages/medicalquestion.css" rel="stylesheet" />
<script src="~/hr/js/Medical.js"></script>
<div class="row">
    <div class="col-md-12">
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title" style="background:url(/hr/img/horizonal.gif) no-repeat left bottom;padding-bottom:10px;">
           Medical Questionnaire <small>Medical Questionnaire Management</small>
        </h3>
        <!-- END PAGE TITLE & BREADCRUMB-->
    </div>
</div>
<div class="row">
    <form id="frmmedical" name="frmmedical" action='/Personal/MedicalQuestion' method="post">
    <div class="col-md-12" style="display:block;color:#2f2e2e;font-size:12px;margin-bottom:15px;text-align:justify">
       <p>A disability or health problem does not preclude full consideration for the position applied for. Please state if you are or have ever suffered from any of the following by ticking the appropriate box and giving full details of the complaint in the space provided, including dates of occurrence where possible.</p>
        <p>As a result of the information you have been given we may seek permission to contact your doctor for further details or you may be referred to a doctor appointed by the Company so that a medical examination can be carried out.</p>
        <p>I agree to undergo a medical examination if required (delete as appropriate) – Yes/No.</p>
        <div style="display:block;clear:left;margin-left:50px;">
        @*<label style="display:block;float:left;margin-right:25px;"><input type="radio" name="agree" value="0" />No</label>
        <label><input type="radio" name="agree" value="1"/>Yes</label>*@
            @Html.Raw(ViewBag.agree)
        </div>     
        <div>I agree to undergo alcohol and/or drugs testing if required (delete as appropriate)</div>
        <p>Please check that you have answered all of the questions correctly.</p>
        <p>I declare that the statements obtained in this document are true and that I have not knowingly withheld any information. I understand that if I am appointed and the information I have provided is incorrect or in any way misleading, I will be liable for dismissal.</p>
    </div>
    <div class="col-md-12">
        <ul style="list-style:none;">
            <li><label>Name: <i>@Users.Current(User.Identity.Name).tblPersonal.FullName</i></label></li>
            <li><label>Department: <i>@Html.Raw( Users.Current(User.Identity.Name).tblPersonal.Department.DepartmentName)</i></label></li>
            <li><label>Start Date: <i>@ViewBag.starttime</i></label></li>
        </ul>
    </div>
    <div id="msg-frMedical"></div>
    <div class="col-md-12" style="margin:10px;">
        <button type="submit" class="btn green" onclick="javascript:return confirm('Are you sure?');" style="height:28px;margin:0px;padding:0px 15px;">Save <i class="icon-save" ></i></button>
        <a class="btn green" style="height:28px;margin:0px;padding:0px 15px;padding-top:5px;"><span class="showdetails">Details<i class="glyphicon glyphicon-fullscreen" style="padding-left:5px;"></i></span></a>
    </div>
    <div class="col-md-12"> 
       <div style="width:100%;">
         @*<div class="container">
                            <div class="hdquestion"><i style="margin-right:5px;">1.</i>Are you a smoker, if so how many a day?</div>
                            <div class="hdno"><label><input  name="rdb" type="radio" value="0" checked="checked" style="margin:0px;">No</label></div>
                            <div class="hdyes"><label><input  name="rdb" type="radio" value="1" style="margin:0px;width:45px; ">Yes</label></div>
                            <div class="content">
                                <ul >
                                    <li style="list-style:none;display:block;margin-left:-30px;clear:left;">
                                             <label class="givedetail">Please give full details where you have answered “Yes”</label>
                                             <textarea name="txtdetail" cols="20" class="txtdetail" rows="4" wrap="soft" maxlength="7000" style="width:100%"></textarea>
                                    </li>
                                </ul>
                            </div>
                       </div>*@
           @Html.Raw(ViewBag.Questionare)
       </div> 
<div class="col-md-12" style="margin:10px;">
        <button type="submit" class="btn green" onclick="javascript:return confirm('Are you sure?');" style="height:28px;margin:0px;padding:0px 15px;">Save <i class="icon-save" ></i></button>
        <a class="btn green" style="height:28px;margin:0px;padding:0px 15px;padding-top:5px;"><span class="showdetails">Details<i class="glyphicon glyphicon-fullscreen" style="padding-left:5px;"></i></span></a>
</div>
<script type="text/javascript">
    $(".hdyes").click(function () {
        $header = $(this);
        $content = $header.next();
        var htmlString = $content.html();
        $content.slideToggle(2, function () {  $header.text(function () {   return htmlString.html; });  });

    });
    $(".hdno").click(function () {
        $header = $(this);
        $content = $header.next().next();
        var htmlString = $header.html();
        if ($content.is(":visible") ) {  $(".content").hide(2); }        
    });
    $(".showdetails").click(function () {
        var htmlString = "";
        $detail = $(this);
        var abc = $(".hdyes");
            $(abc).each(function (index, element) {
                $header = $(element);
                $text = $header.next();
                $content = $header.next().find("textarea");
                htmlString = $content.html();
                if (htmlString.length > 0)
                    if ($detail.text() == "Details") { $text.show(2); }
                    else { $text.hide(2); }
            });
        //$detail = $(".showdetails");
        var colapse = $("<span>Collapse<i class=\"glyphicon glyphicon-import\" style=\"padding-left:5px;\"></i></span>");
        var details = $("<span>Details<i class=\"glyphicon glyphicon-fullscreen\" style=\"padding-left:5px;\"></i></span>");
        $detail.html(function () {
            if ($detail.text() == "Details")
            {
                return colapse;
            }
            else { return details; }
        });
        $b = $(".showdetails");
        $b.each(function(i,el){
            $(el).html(function () { return $detail.html();});
        });
     });
</script>
    </div>
    
    </form>
</div>